/**
卖飞机票：机票价格按照淡季旺季、头等舱和经济舱收费、输入机票原价、月份和头等舱或经济舱。
 按照如下规则计算机票价格：旺季（5-10月）头等舱9折，经济舱8.5折，淡季（11月到来年4月）头等舱7折，经济舱6.5折。
 */
import java.util.Scanner;
public class zhuan1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入机票原价：");
        double price = sc.nextDouble();
        System.out.println("请输入月份：");
        int month = sc.nextInt();
        if(month<1||month>12){
            System.out.println("月份输入有误！");
            return;
        }
        System.out.println("请输入舱位：1头等舱 2经济舱");
        int seat = sc.nextInt();
        double result = getPrice(price,month,seat);
        System.out.println("机票最终价格为："+result);
    }
    public static double getPrice(double price,int month,int seat){
        if(month>=5&&month<=10){
            if(seat==1){
                price = price*0.9;
            }else if(seat==2){
                price = price*0.85;
            }
        }else{
            if(seat==1){
                price = price*0.7;
            }else if(seat==2){
                price = price*0.65;
            }
        }
        return price;
    }
}
